home *** CD-ROM | disk | FTP | other *** search
/ InfoMagic Internet Tools 1995 April / Internet Tools.iso / infoserv / www / cern / dev / www-talk.9301-9306.Z / www-talk.9301-9306 / multipart0632.out < prev    next >
Encoding:
Text File  |  1995-04-24  |  3.6 KB  |  102 lines

  1.  
  2. --cut-here
  3.  
  4. >I see placeholders in the httpd code for RTF, and documentation on the
  5. >web saying that this is being considered, but how long is it likely to
  6. >be before I can feed RTF to the web? Is anyone actively working on
  7. >this?
  8.  
  9. I have been, but I don't expect to be able to do much more work
  10. on it.
  11.  
  12. > If so, would you like an alpha/beta test site? If not, where can
  13. >I get an RTF format definition, so that I can have a go myself?
  14.  
  15. I wrote a Motif widget for displaying RTF stuff -- it probably
  16. doesn't directly support the hypertext conventions you used in
  17. your RTF documents, but you should be able to fix it somehow.
  18.  
  19. Most of the RTF parsing code was written by Paul DuBois. Ask
  20. archie about the RTFstuff package.
  21.  
  22. Here's the source distribution for my widget:
  23.  
  24. --cut-here
  25. Content-Type: message/external-body;
  26.     access-type=ANON-FTP;
  27.     site="export.lcs.mit.edu";
  28.     directory="contrib";
  29.     name="XcRichText-1.5.tar.Z";
  30.  
  31. Content-Type: application/x-tarZ; name="XcRichText-1.5.tar.Z"
  32.  
  33. --cut-here
  34.  
  35. As for RTF and WWW:
  36.  
  37. I'm working on an architecture for dealing with HTML documents
  38. in various formats. There's a base HMDoc class, whose essential
  39. methods are startTag, data, and endTag. I've written two parsers:
  40.  
  41. SGML_parseInstance -- parses an SGML instance, and calls the HMDoc's
  42.     startTag, data, and endTag methods as the info is parsed.
  43. Plaintext_parse -- parses plain text files. Calls the HMDoc's
  44.     startTag method to start a PRE element, then calls the data
  45.     method repeatedly to load the data, then calls the endTag
  46.     method.
  47.  
  48. And I'ver written three HMDoc subclasses:
  49.  
  50. InCore -- builds a data structure to store all the information from
  51.     the tags and data. You can call it's traverse method, and
  52.     it will traverse the data structure and pass all the tags
  53.     and data to another HMDoc.
  54. HTMLwriter -- responds to startTag, endTag methods by writing SGML
  55.     markup to a stream. Responds to data method by writing it
  56.     to a stream, representing <, >, and & as character references.
  57. MIFwriter -- responds to methods by writing a MIF representation
  58.     of the document to a stream.
  59.  
  60. So, for example, you can use SGML_parseInstance to read an HTML
  61. document into an InCore HMDoc, then use the InCore traverse method
  62. to pass the data to a MIFwriter to write it in MIF format.
  63. Or you could use Plaintext_parse and give it a MIFwriter, and convert
  64. straight from plain text to MIF witout ever storing the document
  65. in memory.
  66.  
  67. These modules are designed to drop into existing clients. For
  68. example, the xmosaic client has a Save As... dialog box with
  69. several format options. All you need to do is map the
  70. format options to HMDoc subclasses. Then traverse the document,
  71. calling the HMDoc's tag and data methods, and it will write
  72. the document in the appropriate format.
  73.  
  74. The GridText module from the linemode browser could be turned
  75. into another HMDoc subclass.
  76.  
  77. Also, it should be easy to write LaTeXwriter or RTFwriter subclasses.
  78.  
  79. To support reading RTF documents, I'd start with Paul Dubois'
  80. RTF parsing stuff, and make it into a routine like SGML_parseInstance.
  81. The routine would have to recognize the RTF equivalent of start
  82. tags, end tags, and data.
  83.  
  84. If your RTF files have paragraph tags that match the HTML tags,
  85. it's easy. If, on the other hand, your RTF files were written
  86. without HTML in mind, you've got a more difficult task on your
  87. hand.
  88.  
  89. You have two options: 1) try to zen some HTML structure out of the
  90. info in the RTF file, or 2) treat the RTF file essentially as
  91. a graphic, and use something like my RTF widget to display it.
  92.  
  93. Option 2 doesn't allow you to integrate hypertext in your RTF
  94. documents with WWW, but it may be the easiest way to go.
  95.  
  96.  
  97. Dan
  98.  
  99. --cut-here--
  100.  
  101.  
  102.